<?php
class Organizations extends Admin_Controller
{
	function __construct()
	{
		parent::__construct();
	}
	
	function form($id=FALSE){
		$data['organize'] = new Organization($id);
		$this->template->build('admin/organize_form',$data);
	}
	
	function save($id=FALSE){
		if($_POST){
			$organize = new Organization($id);
			if(!$id)$_POST['user_id'] = $this->session->userdata('id');
			$organize->from_array($_POST);
			$organize->save();
			set_notify('success', lang('save_data_complete'));
		}
		redirect('organizations/admin/organizations/form/'.$_POST['id']);
	}
}
?>